看bigcache库的时候,注意到存放数据用的是PutUvarint、Uvarint,那这两个方法是做什么的呢?
PutUvarint
源码及注释
1 | // PutUvarint encodes a uint64 into buf and returns the number of bytes written. |
代码示例
1 | package main |
输出结果
1 | 8101 |
Uvarint
源码及注释
1 | // Uvarint decodes a uint64 from buf and returns that value and the |
代码示例
1 | package main |
输出结果
1 | 1 |
在线16进制转10进制:https://jisuan5.com/hexadecimal-to-decimal/
参考文章:https://cloud.tencent.com/developer/section/1141534